resum = 1
for i in range(2,10):
    is_True = True
    j = 1
    while is_True:
        tmp = i**j
        if len(str(tmp)) == j:
            resum += 1
            print('%d,%d' % (i,j))
        if len(str(tmp)) < j:
            is_True = False
        j += 1
print(resum)